package com.uaf.aes.utils;

import java.util.Random;
import java.util.UUID;

/**
 * @author cailu
 * @filename RandomUtils
 * @description
 * @date 2020/4/30 9:45
 */
public class RandomUtils {
	public static String randomUUID() {
		return UUID.randomUUID().toString().replace("-", "");
	}

	/**
	 * 功能描述  十六进制随机数
	 * @param len
	 * @return java.lang.String
	 * @author cailu
	 * @date 2020/4/30 15:22
	 */
	public static String randomHexString(int len) {
		try {
			StringBuffer result = new StringBuffer();
			for (int i = 0; i < len; i++) {
				result.append(Integer.toHexString(new Random().nextInt(16)));
			}
			return result.toString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}


}
